function AdminControlPanel(Rank)

local Panel = vgui.Create( "DFrame")
	Panel:SetPos( (ScrW()/2) - 250, (ScrH()/2) - 250 )
	Panel:SetSize( 490,500 )
	Panel:SetVisible(true)
	Panel:SetDraggable( PanelTogl )
	Panel:SetTitle( "Matte's Mod Admin Panel" )
	Panel:MakePopup()
	
 
	-------------- Admin Controls Menu -----------------
 
local AdminControls = vgui.Create( "DPanel" , sheet )
	AdminControls:SetPos(0,0)
	AdminControls:SetSize( 480,460 )
	AdminControls.Paint = function() -- Paint function
    surface.SetDrawColor( 80, 80, 80, 255 ) -- Set our rect color below us; we do this so you can see items added to this panel
    surface.DrawRect( 0, 0, AdminControls:GetWide(), AdminControls:GetTall() ) -- Draw the rect
    surface.SetFont( "default" )
    surface.SetTextColor( 200, 200, 200, 255 )
    surface.SetTextPos( 20, 15 )
    surface.DrawText("Enter desired hostname, press <ENTER> to change. (Must be superadmin to change this)")
end
	
local Slider1 = vgui.Create( "DNumSlider", AdminControls )
	Slider1:SetPos( 20,65 )
	Slider1:SetSize( 200, 100 ) -- Keep the second number at 100
	Slider1:SetText( "Gravity" )
	Slider1:SetMin( 0 ) -- Minimum number of the slider
	Slider1:SetMax( 1200 ) -- Maximum number of the slider
	Slider1:SetDecimals( 0 ) -- Sets a decimal. Zero means it's a whole number
	Slider1:SetValue(tonumber(GetConVarString("sv_gravity")))

	
local Slider2 = vgui.Create( "DNumSlider", AdminControls )
	Slider2:SetPos( 250,65 )
	Slider2:SetSize( 200, 100 ) -- Keep the second number at 100
	Slider2:SetText( "Timescale" )
	Slider2:SetMin( 0.25 ) -- Minimum number of the slider
	Slider2:SetMax( 2 ) -- Maximum number of the slider
	Slider2:SetDecimals( 2 ) -- Sets a decimal. Zero means it's a whole number
	Slider2:SetValue(tonumber(GetConVarString("phys_timescale")))
	
local DermaText2 = vgui.Create("DTextEntry", AdminControls)
	DermaText2:SetPos( 20,30 )
	DermaText2:SetTall( 20 )
	DermaText2:SetWide( 420 )
	DermaText2:SetEnterAllowed( true )
	DermaText2:SetValue(GetConVarString("hostname"))
	
local GodmodeToggle = vgui.Create( "DCheckBoxLabel", AdminControls )
    GodmodeToggle:SetText( "God Mode" )
	GodmodeToggle:SetPos(25,130)
	GodmodeToggle:SetChecked(GetConVarString("sbox_godmode"))
    GodmodeToggle:SizeToContents()
 
    PlplToggle = vgui.Create( "DCheckBoxLabel", AdminControls )
    PlplToggle:SetText( "Player Damage" )
	PlplToggle:SetPos(25,150)
	PlplToggle:SetChecked(tobool(GetConVarString("sbox_plpldamage")))
    PlplToggle:SizeToContents()
 
    local FalldmgToggle = vgui.Create( "DCheckBoxLabel", AdminControls )
    FalldmgToggle:SetText( "Fall Damage" )
	FalldmgToggle:SetPos(25,170)
	FalldmgToggle:SetChecked(tobool(GetConVarString("mp_falldamage")))
    FalldmgToggle:SizeToContents()
 
    local NoclipToggle = vgui.Create( "DCheckBoxLabel", AdminControls )
    NoclipToggle:SetText( "Noclip" )
	NoclipToggle:SetPos(25,190)
	NoclipToggle:SetChecked(tobool(GetConVarString("sbox_noclip")))
    NoclipToggle:SizeToContents()
 
    local AlltalkToggle = vgui.Create( "DCheckBoxLabel", AdminControls )
    AlltalkToggle:SetText( "All Talk" )
	AlltalkToggle:SetPos(25,210)
	AlltalkToggle:SetChecked(tobool(GetConVarString("sv_alltalk")))
    AlltalkToggle:SizeToContents()

local Applybutton = vgui.Create( "DButton", AdminControls )
Applybutton:SetText( "Apply Changes" )
Applybutton:SetPos( 100, 405 )
Applybutton:SetSize( 280, 20 )
Applybutton.DoClick = function ()
	if AlltalkToggle:GetChecked(true) ~= tobool(GetConVarString("sv_alltalk")) then
		local Val = tonumber(AlltalkToggle:GetChecked(true))
		if Val == nil then Val = 0 end
		RunConsoleCommand("sbox_mm_alltalk", Val)
	end
	if NoclipToggle:GetChecked(true) ~= tobool(GetConVarString("sbox_noclip")) then
		local Val = tonumber(NoclipToggle:GetChecked(true))
		if Val == nil then Val = 0 end
		RunConsoleCommand("sbox_mm_noclip", Val)
	end
	if FalldmgToggle:GetChecked(true) ~= tobool(GetConVarString("mp_falldamage")) then
		local Val = tonumber(FalldmgToggle:GetChecked(true))
		if Val == nil then Val = 0 end
		RunConsoleCommand("sbox_mm_falldmg", Val)
	end
	if PlplToggle:GetChecked(true) ~= tobool(GetConVarString("sbox_plpldamage")) then
		local Val = tonumber(PlplToggle:GetChecked(true))
		if Val == nil then Val = 0 end
		RunConsoleCommand("sbox_mm_plpldmg", Val)
	end
	if GodmodeToggle:GetChecked(true) ~= tobool(GetConVarString("sbox_godmode")) then
		local Val = tonumber(GodmodeToggle:GetChecked(true))
		if Val == nil then Val = 0 end
		RunConsoleCommand("sbox_mm_godmode", Val)
	end
	if DermaText2:GetValue() ~= tostring(GetConVarString("hostname")) then
		local Val = tostring(DermaText2:GetValue())
		RunConsoleCommand("sbox_mm_hostname", Val)
	end
	if Slider2:GetValue() ~= tonumber(GetConVarString("phys_timescale")) then
		local Val=tonumber(Slider2:GetValue())
		RunConsoleCommand("sbox_mm_timescale", Val)
	end
	if Slider1:GetValue() ~= tonumber(GetConVarString("sv_gravity")) then
		local Val=tonumber(Slider1:GetValue())
		RunConsoleCommand("sbox_mm_gravity", Val)
	end
end	
	

	-----------  Limits Menu  --------------------
	
local Limits = vgui.Create( "DPanel" , sheet )
	Limits:SetPos(0,0)
	Limits:SetSize( 480,460 )
	Limits.Paint = function() -- Paint function
    surface.SetDrawColor( 80, 80, 80, 255 ) -- Set our rect color below us; we do this so you can see items added to this panel
    surface.DrawRect( 0, 0, Limits:GetWide(), Limits:GetTall() ) -- Draw the rect
end

	
local SliderMax1 = vgui.Create( "DNumSlider", Limits )
	SliderMax1:SetPos( 20,10 )
	SliderMax1:SetSize( 200, 100 ) -- Keep the second number at 100
	SliderMax1:SetText( "Max Props" )
	SliderMax1:SetMin( 0 ) -- Minimum number of the slider
	SliderMax1:SetMax( 400 ) -- Maximum number of the slider
	SliderMax1:SetDecimals( 0 ) -- Sets a decimal. Zero means it's a whole number
	SliderMax1:SetValue(tonumber(GetConVarString("sbox_maxprops")))
		
local SliderMax2 = vgui.Create( "DNumSlider", Limits )
	SliderMax2:SetPos( 250,10 )
	SliderMax2:SetSize( 200, 100 ) -- Keep the second number at 100
	SliderMax2:SetText( "Max Balloons" )
	SliderMax2:SetMin( 0 ) -- Minimum number of the slider
	SliderMax2:SetMax( 80 ) -- Maximum number of the slider
	SliderMax2:SetDecimals( 0 ) -- Sets a decimal. Zero means it's a whole number
	SliderMax2:SetValue(tonumber(GetConVarString("sbox_maxballoons")))
	
local SliderMax3 = vgui.Create( "DNumSlider", Limits )
	SliderMax3:SetPos( 20,60 )
	SliderMax3:SetSize( 200, 100 ) -- Keep the second number at 100
	SliderMax3:SetText( "Max Buttons" )
	SliderMax3:SetMin( 0 ) -- Minimum number of the slider
	SliderMax3:SetMax( 30 ) -- Maximum number of the slider
	SliderMax3:SetDecimals( 0 ) -- Sets a decimal. Zero means it's a whole number
	SliderMax3:SetValue(tonumber(GetConVarString("sbox_maxbuttons")))
	
local SliderMax4 = vgui.Create( "DNumSlider", Limits )
	SliderMax4:SetPos( 250,60 )
	SliderMax4:SetSize( 200, 100 ) -- Keep the second number at 100
	SliderMax4:SetText( "Max Dynamite" )
	SliderMax4:SetMin( 0 ) -- Minimum number of the slider
	SliderMax4:SetMax( 50 ) -- Maximum number of the slider
	SliderMax4:SetDecimals( 0 ) -- Sets a decimal. Zero means it's a whole number
	SliderMax4:SetValue(tonumber(GetConVarString("sbox_maxdynamite")))
	
local SliderMax5 = vgui.Create( "DNumSlider", Limits )
	SliderMax5:SetPos( 20,110 )
	SliderMax5:SetSize( 200, 100 ) -- Keep the second number at 100
	SliderMax5:SetText( "Max Effects" )
	SliderMax5:SetMin( 0 ) -- Minimum number of the slider
	SliderMax5:SetMax( 15 ) -- Maximum number of the slider
	SliderMax5:SetDecimals( 0 ) -- Sets a decimal. Zero means it's a whole number
	SliderMax5:SetValue(tonumber(GetConVarString("sbox_maxeffects")))
	
local SliderMax6 = vgui.Create( "DNumSlider", Limits )
	SliderMax6:SetPos( 250,110 )
	SliderMax6:SetSize( 200, 100 ) -- Keep the second number at 100
	SliderMax6:SetText( "Max Emitters" )
	SliderMax6:SetMin( 0 ) -- Minimum number of the slider
	SliderMax6:SetMax( 10 ) -- Maximum number of the slider
	SliderMax6:SetDecimals( 0 ) -- Sets a decimal. Zero means it's a whole number
	SliderMax6:SetValue(tonumber(GetConVarString("sbox_maxemitters")))
	
local SliderMax7 = vgui.Create( "DNumSlider", Limits )
	SliderMax7:SetPos( 20,160 )
	SliderMax7:SetSize( 200, 100 ) -- Keep the second number at 100
	SliderMax7:SetText( "Max Hoverballs" )
	SliderMax7:SetMin( 0 ) -- Minimum number of the slider
	SliderMax7:SetMax( 20 ) -- Maximum number of the slider
	SliderMax7:SetDecimals( 0 ) -- Sets a decimal. Zero means it's a whole number
	SliderMax7:SetValue(tonumber(GetConVarString("sbox_maxhoverballs")))
	
local SliderMax8 = vgui.Create( "DNumSlider", Limits )
	SliderMax8:SetPos( 250,160 )
	SliderMax8:SetSize( 200, 100 ) -- Keep the second number at 100
	SliderMax8:SetText( "Max Lamps" )
	SliderMax8:SetMin( 0 ) -- Minimum number of the slider
	SliderMax8:SetMax( 15 ) -- Maximum number of the slider
	SliderMax8:SetDecimals( 0 ) -- Sets a decimal. Zero means it's a whole number
	SliderMax8:SetValue(tonumber(GetConVarString("sbox_maxlamps")))
	
local SliderMax9 = vgui.Create( "DNumSlider", Limits )
	SliderMax9:SetPos( 20,210 )
	SliderMax9:SetSize( 200, 100 ) -- Keep the second number at 100
	SliderMax9:SetText( "Max Lights" )
	SliderMax9:SetMin( 0 ) -- Minimum number of the slider
	SliderMax9:SetMax( 15 ) -- Maximum number of the slider
	SliderMax9:SetDecimals( 0 ) -- Sets a decimal. Zero means it's a whole number
	SliderMax9:SetValue(tonumber(GetConVarString("sbox_maxlights")))
	
local SliderMax10 = vgui.Create( "DNumSlider", Limits )
	SliderMax10:SetPos( 250,210 )
	SliderMax10:SetSize( 200, 100 ) -- Keep the second number at 100
	SliderMax10:SetText( "Max NPCs" )
	SliderMax10:SetMin( 0 ) -- Minimum number of the slider
	SliderMax10:SetMax( 10 ) -- Maximum number of the slider
	SliderMax10:SetDecimals( 0 ) -- Sets a decimal. Zero means it's a whole number
	SliderMax10:SetValue(tonumber(GetConVarString("sbox_maxnpcs")))
	
local SliderMax11 = vgui.Create( "DNumSlider", Limits )
	SliderMax11:SetPos( 20,260 )
	SliderMax11:SetSize( 200, 100 ) -- Keep the second number at 100
	SliderMax11:SetText( "Max Ragdolls" )
	SliderMax11:SetMin( 0 ) -- Minimum number of the slider
	SliderMax11:SetMax( 10 ) -- Maximum number of the slider
	SliderMax11:SetDecimals( 0 ) -- Sets a decimal. Zero means it's a whole number
	SliderMax11:SetValue(tonumber(GetConVarString("sbox_maxragdolls")))
	
local SliderMax12 = vgui.Create( "DNumSlider", Limits )
	SliderMax12:SetPos( 250,260 )
	SliderMax12:SetSize( 200, 100 ) -- Keep the second number at 100
	SliderMax12:SetText( "Max Spawners" )
	SliderMax12:SetMin( 0 ) -- Minimum number of the slider
	SliderMax12:SetMax( 8 ) -- Maximum number of the slider
	SliderMax12:SetDecimals( 0 ) -- Sets a decimal. Zero means it's a whole number
	SliderMax12:SetValue(tonumber(GetConVarString("sbox_maxspawners")))
	
local SliderMax13 = vgui.Create( "DNumSlider", Limits )
	SliderMax13:SetPos( 20,310 )
	SliderMax13:SetSize( 200, 100 ) -- Keep the second number at 100
	SliderMax13:SetText( "Max Thrusters" )
	SliderMax13:SetMin( 0 ) -- Minimum number of the slider
	SliderMax13:SetMax( 15 ) -- Maximum number of the slider
	SliderMax13:SetDecimals( 0 ) -- Sets a decimal. Zero means it's a whole number
	SliderMax13:SetValue(tonumber(GetConVarString("sbox_maxthrusters")))
	
local SliderMax14 = vgui.Create( "DNumSlider", Limits )
	SliderMax14:SetPos( 250,310 )
	SliderMax14:SetSize( 200, 100 ) -- Keep the second number at 100
	SliderMax14:SetText( "Max Turrets" )
	SliderMax14:SetMin( 0 ) -- Minimum number of the slider
	SliderMax14:SetMax( 10 ) -- Maximum number of the slider
	SliderMax14:SetDecimals( 0 ) -- Sets a decimal. Zero means it's a whole number
	SliderMax14:SetValue(tonumber(GetConVarString("sbox_maxturrets")))
	
local SliderMax15 = vgui.Create( "DNumSlider", Limits )
	SliderMax15:SetPos( 20,360 )
	SliderMax15:SetSize( 200, 100 ) -- Keep the second number at 100
	SliderMax15:SetText( "Max Vehicles" )
	SliderMax15:SetMin( 0 ) -- Minimum number of the slider
	SliderMax15:SetMax( 5 ) -- Maximum number of the slider
	SliderMax15:SetDecimals( 0 ) -- Sets a decimal. Zero means it's a whole number
	SliderMax15:SetValue(tonumber(GetConVarString("sbox_maxvehicles")))
	
local SliderMax16 = vgui.Create( "DNumSlider", Limits )
	SliderMax16:SetPos( 250,360 )
	SliderMax16:SetSize( 200, 100 ) -- Keep the second number at 100
	SliderMax16:SetText( "Max Wheels" )
	SliderMax16:SetMin( 0 ) -- Minimum number of the slider
	SliderMax16:SetMax( 15 ) -- Maximum number of the slider
	SliderMax16:SetDecimals( 0 ) -- Sets a decimal. Zero means it's a whole number
	SliderMax16:SetValue(tonumber(GetConVarString("sbox_maxwheels")))
	
local Applybutton = vgui.Create( "DButton", Limits )
Applybutton:SetText( "Apply Changes" )
Applybutton:SetPos( 100, 405 )
Applybutton:SetSize( 280, 20 )
Applybutton.DoClick = function ()
	if SliderMax1:GetValue() ~= tonumber(GetConVarString("sbox_maxprops")) then
		local Val=SliderMax1:GetValue()
		RunConsoleCommand("sbox_mm_MaxPr", Val)
	end
	if SliderMax2:GetValue() ~= tonumber(GetConVarString("sbox_maxballoons")) then
		local Val=SliderMax2:GetValue()
		RunConsoleCommand("sbox_mm_MaxBa", Val)
	end
	if SliderMax3:GetValue() ~= tonumber(GetConVarString("sbox_maxbuttons")) then
		local Val=SliderMax3:GetValue()
		RunConsoleCommand("sbox_mm_MaxBu", Val)
	end
	if SliderMax4:GetValue() ~= tonumber(GetConVarString("sbox_maxdynamite")) then
		local Val=SliderMax4:GetValue()
		RunConsoleCommand("sbox_mm_MaxDy", Val)
	end
	if SliderMax5:GetValue() ~= tonumber(GetConVarString("sbox_maxeffects")) then
		local Val=SliderMax5:GetValue()
		RunConsoleCommand("sbox_mm_MaxEf", Val)
	end
	if SliderMax6:GetValue() ~= tonumber(GetConVarString("sbox_maxemitters")) then
		local Val=SliderMax6:GetValue()
		RunConsoleCommand("sbox_mm_MaxEm", Val)
	end
	if SliderMax7:GetValue() ~= tonumber(GetConVarString("sbox_maxhoverballs")) then
		local Val=SliderMax7:GetValue()
		RunConsoleCommand("sbox_mm_MaxHo", Val)
	end
	if SliderMax8:GetValue() ~= tonumber(GetConVarString("sbox_maxlamps")) then
		local Val=SliderMax8:GetValue()
		RunConsoleCommand("sbox_mm_MaxLa", Val)
	end
	if SliderMax9:GetValue() ~= tonumber(GetConVarString("sbox_maxlights")) then
		local Val=SliderMax9:GetValue()
		RunConsoleCommand("sbox_mm_MaxLi", Val)
	end
	if SliderMax10:GetValue() ~= tonumber(GetConVarString("sbox_maxnpcs")) then
		local Val=SliderMax10:GetValue()
		RunConsoleCommand("sbox_mm_MaxNP", Val)
	end
	if SliderMax11:GetValue() ~= tonumber(GetConVarString("sbox_maxragdolls")) then
		local Val=SliderMax11:GetValue()
		RunConsoleCommand("sbox_mm_MaxRa", Val)
	end
	if SliderMax12:GetValue() ~= tonumber(GetConVarString("sbox_maxspawners")) then
		local Val=SliderMax12:GetValue()
		RunConsoleCommand("sbox_mm_MaxSp", Val)
	end
	if SliderMax13:GetValue() ~= tonumber(GetConVarString("sbox_maxthrusters")) then
		local Val=SliderMax13:GetValue()
		RunConsoleCommand("sbox_mm_MaxTh", Val)
	end
	if SliderMax14:GetValue() ~= tonumber(GetConVarString("sbox_maxturrets")) then
		local Val=SliderMax14:GetValue()
		RunConsoleCommand("sbox_mm_MaxTu", Val)
	end
	if SliderMax15:GetValue() ~= tonumber(GetConVarString("sbox_maxvehicles")) then
		local Val=SliderMax15:GetValue()
		RunConsoleCommand("sbox_mm_MaxVe", Val)
	end
	if SliderMax16:GetValue() ~= tonumber(GetConVarString("sbox_maxwheels")) then
		local Val=SliderMax16:GetValue()
		RunConsoleCommand("sbox_mm_MaxWh", Val)
	end
end

	-------------- Kick \ Ban Menu ----------------------
	
local UserMenu = vgui.Create( "DPanel" , sheet )
	UserMenu:SetPos(0,0)
	UserMenu:SetSize( 480,460 )
	UserMenu.Paint = function() -- Paint function
    surface.SetDrawColor( 80, 80, 80, 255 ) -- Set our rect color below us; we do this so you can see items added to this panel
    surface.DrawRect( 0, 0, UserMenu:GetWide(), UserMenu:GetTall() ) -- Draw the rect
end


local PlayerList = vgui.Create( "DComboBox", UserMenu )
PlayerList:SetPos( 10, 35 )
PlayerList:SetSize( 120, 300 )
PlayerList:SetMultiple( false )
PlayerList:Clear()
for k, v in pairs(player.GetAll()) do
	PlayerList:AddItem(v:Nick())
end
	
local Bantime = vgui.Create("DTextEntry", UserMenu)
Bantime:SetPos(150,20)
Bantime:SetSize(50,20)
Bantime:SetText("perma")
Bantime:SetEnterAllowed( true )
Bantime.OnEnter = function()
if Bantime:GetValue() then
	local Time = tonumber(Bantime:GetValue())
elseif !Bantime:GetValue() or Bantime:GetValue() == "perma" then
	local Time = 0
end
end

local Banbutton = vgui.Create( "DButton", UserMenu )
Banbutton:SetText( "Ban" )
Banbutton:SetPos( 150, 40 )
Banbutton:SetSize( 50, 50 )
Banbutton.DoClick = function ()
	if PlayerList:GetSelectedItems() then
		RunConsoleCommand("mm_ban",PlayerList:GetSelectedItems()[1]:GetValue(),Time)
	end
end

local Kickbutton = vgui.Create( "DButton", UserMenu )
Kickbutton:SetText( "Kick" )
Kickbutton:SetPos( 230, 40 )
Kickbutton:SetSize( 50, 50 )
Kickbutton.DoClick = function ()
	if PlayerList:GetSelectedItems() then
		RunConsoleCommand("mm_kick",PlayerList:GetSelectedItems()[1]:GetValue())
	end
end

local Godbutton = vgui.Create( "DButton", UserMenu )
Godbutton:SetText( "God" )
Godbutton:SetPos( 310, 40 )
Godbutton:SetSize( 50, 50 )
Godbutton.DoClick = function ()
	if PlayerList:GetSelectedItems() then
		RunConsoleCommand("mm_god",PlayerList:GetSelectedItems()[1]:GetValue())
	end
end

local Ungodbutton = vgui.Create( "DButton", UserMenu )
Ungodbutton:SetText( "Ungod" )
Ungodbutton:SetPos( 390, 40 )
Ungodbutton:SetSize( 50, 50 )
Ungodbutton.DoClick = function ()
	if PlayerList:GetSelectedItems() then
		RunConsoleCommand("mm_ungod",PlayerList:GetSelectedItems()[1]:GetValue())
	end
end

local Ignitebutton = vgui.Create( "DButton", UserMenu )
Ignitebutton:SetText( "Ignite" )
Ignitebutton:SetPos( 150, 120 )
Ignitebutton:SetSize( 50, 50 )
Ignitebutton.DoClick = function ()
	if PlayerList:GetSelectedItems() then
		RunConsoleCommand("mm_ignite",PlayerList:GetSelectedItems()[1]:GetValue())
	end
end

local Unignitebutton = vgui.Create( "DButton", UserMenu )
Unignitebutton:SetText( "Unignite" )
Unignitebutton:SetPos( 230, 120 )
Unignitebutton:SetSize( 50, 50 )
Unignitebutton.DoClick = function ()
	if PlayerList:GetSelectedItems() then
		RunConsoleCommand("mm_unignite",PlayerList:GetSelectedItems()[1]:GetValue())
	end
end

local Cloakbutton = vgui.Create( "DButton", UserMenu )
Cloakbutton:SetText( "Cloak" )
Cloakbutton:SetPos( 310, 120 )
Cloakbutton:SetSize( 50, 50 )
Cloakbutton.DoClick = function ()
	if PlayerList:GetSelectedItems() then
		RunConsoleCommand("mm_cloak",PlayerList:GetSelectedItems()[1]:GetValue())
	end
end

local Uncloakbutton = vgui.Create( "DButton", UserMenu )
Uncloakbutton:SetText( "Uncloak" )
Uncloakbutton:SetPos( 390, 120 )
Uncloakbutton:SetSize( 50, 50 )
Uncloakbutton.DoClick = function ()
	if PlayerList:GetSelectedItems() then
		RunConsoleCommand("mm_uncloak",PlayerList:GetSelectedItems()[1]:GetValue())
	end
end

local Slaybutton = vgui.Create( "DButton", UserMenu )
Slaybutton:SetText( "Kill" )
Slaybutton:SetPos( 150, 200 )
Slaybutton:SetSize( 50, 50 )
Slaybutton.DoClick = function ()
	if PlayerList:GetSelectedItems() then
		RunConsoleCommand("mm_kill",PlayerList:GetSelectedItems()[1]:GetValue())
	end
end

local SSlaybutton = vgui.Create( "DButton", UserMenu )
SSlaybutton:SetText( "Kill Silent" )
SSlaybutton:SetPos( 230, 200 )
SSlaybutton:SetSize( 50, 50 )
SSlaybutton.DoClick = function ()
	if PlayerList:GetSelectedItems() then
		RunConsoleCommand("mm_silentkill",PlayerList:GetSelectedItems()[1]:GetValue())
	end
end

local Mutebutton = vgui.Create( "DButton", UserMenu )
Mutebutton:SetText( "Mute" )
Mutebutton:SetPos( 310, 200 )
Mutebutton:SetSize( 50, 50 )
Mutebutton.DoClick = function ()
	if PlayerList:GetSelectedItems() then
		RunConsoleCommand("mm_mute",PlayerList:GetSelectedItems()[1]:GetValue())
	end
end


----------------- Prop Protection Menu ---------------------

local ProtectionMenu = vgui.Create( "DPanel" , sheet )
	ProtectionMenu:SetPos(0,0)
	ProtectionMenu:SetSize( 480,460 )
	ProtectionMenu.Paint = function() -- Paint function
    surface.SetDrawColor( 80, 80, 80, 255 ) -- Set our rect color below us; we do this so you can see items added to this panel
    surface.DrawRect( 0, 0, ProtectionMenu:GetWide(), ProtectionMenu:GetTall() ) -- Draw the rect
end

local Cleanbutton = vgui.Create( "DButton", ProtectionMenu )
Cleanbutton:SetText( "Cleanup" )
Cleanbutton:SetPos(40, 40 )
Cleanbutton:SetSize( 200, 200 )
Cleanbutton.DoClick = function ()
		RunConsoleCommand("mm_pp_cleanup")
end

local sheet = vgui.Create("DPropertySheet", Panel)
	sheet:SetPos((Panel:GetWide()/2)-240, (Panel:GetTall()/2)-225)
	sheet:SetSize( 480,460 )
	sheet:AddSheet( "Limits", Limits, "gui/silkicons/wrench", false, false, "Control Server Limits" )
	sheet:AddSheet( "Admin Controls", AdminControls, "gui/silkicons/star", false, false, "Control Server Variables" )
	sheet:AddSheet( "User Actions", UserMenu, "gui/silkicons/user", false, false, "Take actions upon users" )
	sheet:AddSheet( "Prop Protection", ProtectionMenu, "gui/silkicons/user", false, false, "Control the Prop Protection" )
	
end

function admin_menu( ply )
	if ply:IsAdmin() then
		AdminControlPanel(Rank)
	else
		ply:PrintMessage( HUD_PRINTTALK, "You're not an admin!" )
	end
end

concommand.Add("admin",admin_menu)